import {$http} from "@/utils/request/requestConfig.js"

const api = {
	"inactive":"api/travel/list",
	"update":"api/travel/update",
	"travelInfo":"api/travel/info",
	"meet":"api/travel/meet/{travelId}",
	"captcha":"api/travel/disabled/getCode/{volunteerId}",
	"meetSuccess":"api/travel/volunteer/meet/{travelId}",

}

export const inactiveTravelList = () => {
	return $http.get(api.inactive)
}

export const travelInfo = (data) => {
	return $http.get(api.travelInfo,data)
}

export const meetTravel = (data) => {
	const meet = api.meet.replace(/{travelId}/,data)
	return $http.get(meet)
}

export const meetSuccess = (data) =>{
	const meetSuccess = api.meetSuccess.replace(/{travelId}/,data)
	return $http.get(meetSuccess)
}


export const getCaptcha = (data) => {
	const captcha = api.captcha.replace(/{volunteerId}/,data)
	return $http.get(captcha)
}

export const updateTravel = (data) => {
	return $http.post(api.update,data)
}